<?php get_header(); the_post(); 
	$decadas = get_terms( 'decada',  'orderby=slug&order=ASC' );
?>										
				<div class="content content-interna">
					<div class="header-post">
						<span class="bread-crumb">
							<?php if(function_exists('bcn_display')) : bcn_display(); endif; ?>
						</span>
						<span class="clear"></span>
						<div class="titulo">Conheça a História de José Mentor</div>
						<span class="clear"></span>
					</div><!-- /header-post -->
					<span class="clear"></span>
					<div class="post">
						<div class="content-post biografia">
							<div class="wrapper-biografia">
								<?php the_content(); ?>
							</div>
							<div class="wrapper-linha-do-tempo">
								<div class="anos">
								<?php 
									if ( count($decadas) > 0 ) :
									    echo '<ul>';
									    foreach ( $decadas as $decada ) :
									    	echo '<li><a href="#' . $decada->slug . '">' . $decada->name . '</li>';
									    endforeach;
									    echo '</ul>';
 									endif;
 								?>
								</div>
								<?php 
									if ( count($decadas) > 0 ) : 
								?>	    
										<div class="desc-anos">
											<ul>
										    <?php foreach ( $decadas as $decada ) : 
													$biografia = new WP_Query(array(
														'post_type'=>'biografia',
														'posts_per_page'=> -1,
														'tax_query' => array(
															array(
																'taxonomy' => 'decada',
																'field' => 'slug',
																'terms' => $decada->slug
															))
														));
													while ($biografia->have_posts()) : $biografia->the_post();
												?>
													<li class="section" id="<?php echo $decada->slug; ?>" >
														<div class="tit-anos"><?php echo $decada->name; ?> </div>
														<div class="tit-post-anos"><?php the_title(); ?></div>
														<div class="data-post-anos"><?php echo get('ano_ano'); ?></div>
														<div class="desc-post-anos">
															<?php the_post_thumbnail('thumbnail'); ?>
															<?php the_content(); ?>
														</div>
														<span class="clear"></span>
													</li>
												<?php endwhile; ?>

										     <?php endforeach; ?>
										     </ul>
										</div>
 								<?php
									endif;
 								?>
							</div><!-- /wrapper-linha-do-tempo -->
						</div><!-- /content-post -->
						<span class="clear"></span>
					</div><!-- /Post -->
					<span class="clear"></span>
					<div class="footer-post">
						<?php if (!is_page('contato')) : ?>
						<div class="share"><div class="addthis_toolbox addthis_default_style addthis_" addthis:url="http://josementor.com.br/site/biografia/" addthis:title="Biografia de José Mentor"><a class="addthis_button_facebook at300b" title="Facebook" href="#"><span class="at16nc at300bs at15nc at15t_facebook at16t_facebook"><span class="at_a11y">Share on facebook</span></span></a><a class="addthis_button_twitter at300b" title="Tweet" href="#"><span class="at16nc at300bs at15nc at15t_twitter at16t_twitter"><span class="at_a11y">Share on twitter</span></span></a><a class="addthis_button_email at300b" target="_blank" title="E-mail" href="#"><span class="at16nc at300bs at15nc at15t_email at16t_email"><span class="at_a11y">Share on email</span></span></a><a class="addthis_button_pinterest_share at300b" target="_blank" title="Pinterest" href="#"><span class="at16nc at300bs at15nc at15t_pinterest_share at16t_pinterest_share"><span class="at_a11y">Share on pinterest_share</span></span></a><a class="addthis_button_compact at300m" href="#"><span class="at16nc at300bs at15nc at15t_compact at16t_compact"><span class="at_a11y">More Sharing Services</span></span></a></div>
						</div>
						<?php endif; ?>
					</div>
				</div><!-- /Content Interna -->

			<?php get_footer(); ?>
